<?php
/**
 * Created by PhpStorm.
 * User: lcz
 * Date: 2018/4/11
 * Time: 14:11
 * 订单
 */
namespace app\mobile\controller;

use app\common\controller\Mobile;

class Order extends Mobile {
	
	/**
	 * 订单列表
	 * @return mixed
	 */
	public function index(){
		$orderStatus = [
			0 => '全部订单',
			1 => '待付款订单',
			2 => '待发货订单',
			3 => '待签收订单',
			4 => '待评价订单'
		];
		$status = input('status',0,'int');
		return $this->fetch('index', [
			'title' => $orderStatus[$status],
			'data' => input(),
		]);
	}
	
	/**
	 * 确认订单
	 * @return mixed
	 */
	public function confirmOrder(){
		return $this->fetch('confirmOrder', [
			'title' => '确认订单',
			'data' => json_encode(input()),
			'url' => $_SERVER['REQUEST_URI'],
		]);
	}
	
	/**
	 * 支付订单
	 * @return mixed
	 */
	public function payOrder(){
		return $this->fetch('payOrder', [
			'title' => '收银台',
			'data' => input(),
		]);
	}
	
	/**
	 * 物流
	 */
	public function shipping(){
		return $this->fetch('shipping', [
			'title' => '物流详情',
			'data' => input(),
		]);
	}
	
	/**
	 * 评价
	 */
	public function comment(){
		return $this->fetch('comment', [
			'title' => '订单评价',
			'data' => input(),
		]);
	}
	
	/**
	 * 订单详情
	 */
	public function detail(){
		return $this->fetch('detail', [
			'title' => '订单详情',
			'data' => input(),
		]);
	}
	
	/**
	 * 补淘宝订单
	 */
	public function addTbOrder(){
		return $this->fetch('addTbOrder', [
			'title' => '淘宝订单',
		]);
	}
}